﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PIPDiliverInfo.aspx.cs" Inherits="Hisun.View.PIPDeliverInfo.PIPDiliverInfo" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
    <style type="text/css">
        .style1
        {
            width: 169px;
        }
        .style2
        {
            width: 285px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div class =" CommonPage_MainPanel">
    <div class ="CommonPage_Banner"><div class = "CommomPage_Title">中间体设置</div></div>
    <div class ="CommonPage_Body">

    
        <table >
            <tr>
                <td colspan="3">
                    
                    
                </td>
            </tr>
            <tr>
                <td colspan="3">
                    
                    <br />
                    <asp:Panel ID="Panel_CenterIdAndPIPid" runat="server"><asp:Label ID="Label7" runat="server" Text="作业中心："></asp:Label>
                    <asp:DropDownList ID="DropDownList_CostCenterId" runat="server" Height="26px" 
                        Width="180px" AutoPostBack="True">
                    </asp:DropDownList><asp:Label ID="Label8" runat="server" Text="作业中心产品："></asp:Label>
                    <asp:DropDownList ID="DropDownList_PIPId" runat="server" 
                        DataSourceID="LinqDataSource1" DataTextField="中间体名称" DataValueField="中间体ID" 
                        Height="19px" Width="180px">
                    </asp:DropDownList>
                    <asp:Button SkinID = "Button" ID="Button_Query" runat="server" oncommand="Button_Query_Command" 
                        Text="查询" />
                    </asp:Panel>
                </td>
            </tr>
            <tr>
                <td colspan="3">
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    说明：录入当前中间体的目标作业中心、目标中间体及转出数量。<br />
                    <asp:Button SkinID = "Button" ID="Button_Add" runat="server" oncommand="Button_Add_Command" 
                        Text="增加" />
                </td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td colspan="3">
                    <asp:Panel ID="Panel_GridView" runat="server"><asp:GridView ID="GridView_PIPDetail" runat="server"  SkinID = "GridView"
                        AutoGenerateColumns="False">
                        <Columns>
                            <asp:BoundField DataField="目标作业中心ID" HeaderText="目标作业中心ID" />
                            <asp:BoundField DataField="目标作业中心名称" HeaderText="目标作业中心名称" />
                            <asp:BoundField DataField="目标中间体ID" HeaderText="目标中间体ID" />
                            <asp:BoundField DataField="目标中间体名称" HeaderText="目标中间体名称" />
                            <asp:BoundField DataField="计量单位" HeaderText="计量单位" />
                            <asp:BoundField DataField="转出数量" HeaderText="转出数量" />
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:Button SkinID = "Button" ID="Button_Edit" runat="server" CommandArgument='<%# Eval("ID") %>' 
                                        oncommand="Button_Edit_Command" Text="编辑" />
                                    <asp:Button SkinID = "Button" ID="Button_Del" runat="server" CommandArgument='<%# Eval("ID") %>' 
                                        Text="删除" onclientclick="return confirm('确定删除当前记录吗？')" 
                                        oncommand="Button_Del_Command" />
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                    </asp:Panel>
                </td>
            </tr>
            <tr>
                <td colspan="3">
                    <table style="width:100%;">
                        <tr>
                            <td>
                                <asp:Panel ID="Panel_EditPanel" runat="server" Visible="False">
                                    <table style="width:100%;">
                                        <tr>
                                            <td>
                                                <asp:Label ID="Label3" runat="server" Text="目标作业中心ID："></asp:Label>
                                            </td>
                                            <td class="style2">
                                                <asp:TextBox ID="TextBox_GoalCenterId" runat="server" ></asp:TextBox>
                                                <asp:Button SkinID = "Button" ID="Button_Center" runat="server" Text="..." 
                                                onclick="Button_Center_Click" />
                                            </td>
                                            <td class="style1">
                                                <asp:Label ID="Label6" runat="server" Text="目标作业中心名称："  ></asp:Label>
                                            </td>
                                            <td>
                                                <asp:TextBox ID="TextBox_GoalCenterName" runat="server"></asp:TextBox>
                                            </td>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Label ID="Label4" runat="server" Text="目标中间体："></asp:Label>
                                            </td>
                                            <td class="style2">
                                                <asp:TextBox ID="TextBox_GoalPIPId" runat="server"></asp:TextBox>
                                            </td>
                                            <td class="style1">
                                                <asp:Label ID="Label10" runat="server" Text="目标中间体名称："></asp:Label>
                                            </td>
                                            <td>
                                                <asp:TextBox ID="TextBox_GoalPIPName" runat="server" ReadOnly="True"></asp:TextBox>
                                            </td>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Label ID="Label9" runat="server" Text="计量单位："></asp:Label>
                                            </td>
                                            <td class="style2">
                                                <asp:TextBox ID="TextBox_Unit" runat="server" ReadOnly="True"></asp:TextBox>
                                            </td>
                                            <td class="style1">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Label ID="Label5" runat="server" Text="转出数量"></asp:Label>
                                            </td>
                                            <td class="style2">
                                                <asp:TextBox ID="TextBox_Amount" runat="server"></asp:TextBox>
                                                <asp:CompareValidator ID="CompareValidator_Amount" runat="server" 
                                                    ControlToValidate="TextBox_Amount" ErrorMessage="*" Operator="DataTypeCheck" 
                                                    Type="Double" ValueToCompare="Group"></asp:CompareValidator>
                                            </td>
                                            <td class="style1">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                    </table>
                                                                    <asp:Button SkinID = "Button" ID="Button_Save" runat="server" Text="保存" 
                                    oncommand="Button_Save_Command" ValidationGroup="Group" />
                                <asp:Button SkinID = "Button" ID="Button_Cancel" runat="server" oncommand="Button_Cancel_Command" 
                                    Text="取消" />
                                </asp:Panel>
                            </td>
                            <td>
                                &nbsp;</td>
                            <td>
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td colspan="3">
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td colspan="3">

                                <asp:HiddenField ID="EditFlag" runat="server" 
                        Value="0"/>
                                <asp:HiddenField ID="EditPIPId" runat="server" 
                        Value="0"/>
                    <asp:HiddenField ID="CenterAndPIPInfo" runat="server" 
                        Value="0"/>
                    <asp:LinqDataSource ID="LinqDataSource1" runat="server" 
                        ContextTypeName="Hisun.Models.HisunDBDataContext" Select="new (中间体ID, 中间体名称)" 
                        TableName="TABC_JS_ProductInProcess" Where="作业中心ID == @作业中心ID &amp;&amp; 可用 == @可用">
                        <WhereParameters>
                            <asp:ControlParameter ControlID="DropDownList_CostCenterId" Name="作业中心ID" 
                                PropertyName="SelectedValue" Type="Int32" />
                            <asp:Parameter DefaultValue="True" Name="可用" Type="Boolean" />
                        </WhereParameters>
                    </asp:LinqDataSource>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    
    </div>
    </div>
    </form>
    
</body>
</html>
